#!/bin/sh
set -e

echo "Importing GPG keys..."
gpg1 --batch --import "${1}"
gpg1 --list-secret-keys
gpg1 --list-keys
gpg1 --version
for fpr in $(gpg1 --list-keys --with-colons  | awk -F: '/fpr:/ {print $10}' | sort -u); do echo -e "5\ny\n" |  gpg1 --batch --command-fd 0 --expert --edit-key ${fpr} trust; done
echo "GPG imported:"
ls -l  /home/jenkins/.gnupg/
